import request from "../../utils/request.js"

const state ={
	cartList:[]
}

const mutations ={
	SET_CARTLIST(state,cartList){
		state.cartList = cartList
	},
	//重置cartList
	SET_RESET(state){
		state.cartList = []
	}
}

const actions ={
	 async	getCartList({commit}){
			const result = await request('/getCartList')
			commit('SET_CARTLIST',result.data)
		}
}

const getters = {}

export default {
	state,
	mutations,
	actions,
	getters
}